package com.hengpeng.itfinbase.persist;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;

import com.hengpeng.common.web.annotation.HtmlInput;
import com.hengpeng.common.web.annotation.HtmlInputPattern;
import com.hengpeng.common.web.annotation.HtmlInputType;
import com.hengpeng.itfinbase.en.AccountType;
import com.hengpeng.itfinbase.idAssign.AbstractAssign18IdEntity;

/**
 * <pre>
 * 资金流水信息表
 * </pre>
 * @author weiyuan
 * @version 1.0, 2015年5月27日
 */
@Entity
public class AccountLog extends AbstractAssign18IdEntity
{
	/**
	 * <pre>
	 * 交易类型
	 * </pre>
	 * @author linriqing
	 * @version 1.0, 2010-7-19
	 */
	public static enum TransType
	{
		IMPREST("充值"),

		IMPREST_FEE("充值手续费"), // 用户充值时,汇付等第三方托管平台会默认扣除平台账户一定的手续费

		DRAW("提现"),

		DRAW_FEE("提现手续费"), // 用户提现时,根据平台配置,第三方平台会扣除提现手续费

		TRANSFER("转账"),

		INVEST("投标"),

		CANCLE("撤标"),

		LOAN("标的放款"),

		LOAN_FEE("标的放款手续费"),

		LOAN_GUAR("标的放款保证金"),

		ADDMONEY("附加利息"),

		REPAYMENT("标的还款"),

		ADVANCEREPAY("垫付还款"),

		PAYBACK("用户偿还垫付"),

		CREDITASSIGN("债权转让"),

		CREDITASSIGN_FEE("债权转让手续费"),

		OTHER("其他");

		private String text;

		TransType(String text)
		{
			this.text = text;
		}

		public String getText()
		{
			return text;
		}

		public void setText(String text)
		{
			this.text = text;
		}
	}

	/**
	 * <pre>
	 * 交易形式
	 * </pre>
	 * @author linriqing
	 * @version 1.0, 2010-7-19
	 */
	public static enum TradeMode
	{
		ADD("转入"),

		SUBTRACT("转出"),

		FREEZE("冻结"),

		UNFREEZE("解冻");

		private String text;

		TradeMode(String text)
		{
			this.text = text;
		}

		public String getText()
		{
			return text;
		}

		public void setText(String text)
		{
			this.text = text;
		}
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = -5967010697826188577L;

	/**
	 * 用户ID
	 */
	@HtmlInput(label = "用户ID", type = HtmlInputType.TEXT, nullable = true, index = 1)
	private Long userId;

	/**
	 * 用户姓名
	 */
	@HtmlInput(label = "用户名", type = HtmlInputType.TEXT, nullable = true, index = 2)
	private String userName;

	/**
	 * 托管账户id
	 */
	@HtmlInput(label = "托管账户id", type = HtmlInputType.TEXT, nullable = true, index = 3)
	private String trustAccountId;

	/**
	 * 账户类型
	 */
	@Enumerated(javax.persistence.EnumType.STRING)
	@HtmlInput(label = "账户类型", type = HtmlInputType.TEXT, labelProperty = "text", nullable = true, index = 4)
	@Column(length = 20)
	private AccountType accountType;

	/**
	 * 交易类型
	 */
	@Enumerated(javax.persistence.EnumType.STRING)
	@HtmlInput(label = "交易类型", type = HtmlInputType.TEXT, labelProperty = "text", nullable = true, index = 5)
	private TransType transType;

	/**
	 * 交易前本金
	 */
	@HtmlInput(label = "交易前本金", type = HtmlInputType.TEXT, nullable = true, index = 6)
	private Long baseMoney;

	/**
	 * 交易后本金
	 */
	@HtmlInput(label = "交易后本金", type = HtmlInputType.TEXT, nullable = true, index = 7)
	private Long remnantBaseMoney;

	/**
	 * 交易后冻结资金
	 */
	@HtmlInput(label = "交易后冻结资金", type = HtmlInputType.TEXT, nullable = true, index = 8)
	private Long remnantFreezeMoney;

	/**
	 * 引用交易的外部流水号
	 */
	@HtmlInput(label = "外部流水号", type = HtmlInputType.TEXT, nullable = true, index = 9)
	private String referenceId;

	/**
	 * 交易金额
	 */
	@HtmlInput(label = "交易金额", type = HtmlInputType.TEXT, nullable = true, index = 10)
	private Long money;

	/**
	 * 交易时间
	 */
	@HtmlInput(label = "交易时间", type = HtmlInputType.TEXT, pattern = HtmlInputPattern.DATETIME, format = "yyyy-MM-dd HH:mm", nullable = true, index = 11)
	private Date transTime;

	/**
	 * 交易形式
	 */
	@Enumerated(javax.persistence.EnumType.STRING)
	@HtmlInput(label = "交易形式", type = HtmlInputType.TEXT, labelProperty = "text", nullable = true, index = 12)
	private TradeMode tradeMode;

	/**
	 * 备注信息
	 */
	@HtmlInput(label = "备注信息", type = HtmlInputType.TEXT, nullable = true, index = 13)
	private String remark;

	/**
	 * 更新时间
	 */
	@HtmlInput(label = "最后修改日期", type = HtmlInputType.TEXT, pattern = HtmlInputPattern.DATETIME, format = "yyyy-MM-dd HH:mm", nullable = true, index = 14)
	private Date updateTime;

	/**
	 * 创建时间
	 */
	@HtmlInput(label = "创建时间", type = HtmlInputType.TEXT, pattern = HtmlInputPattern.DATETIME, format = "yyyy-MM-dd HH:mm", nullable = true, index = 15)
	private Date createTime;

	public Long getUserId()
	{
		return userId;
	}

	public void setUserId(Long userId)
	{
		this.userId = userId;
	}

	public String getUserName()
	{
		return userName;
	}

	public void setUserName(String userName)
	{
		this.userName = userName;
	}

	public String getTrustAccountId()
	{
		return trustAccountId;
	}

	public void setTrustAccountId(String trustAccountId)
	{
		this.trustAccountId = trustAccountId;
	}

	public TransType getTransType()
	{
		return transType;
	}

	public void setTransType(TransType transType)
	{
		this.transType = transType;
	}

	public Long getBaseMoney()
	{
		return baseMoney;
	}

	public void setBaseMoney(Long baseMoney)
	{
		this.baseMoney = baseMoney;
	}

	public Long getRemnantBaseMoney()
	{
		return remnantBaseMoney;
	}

	public void setRemnantBaseMoney(Long remnantBaseMoney)
	{
		this.remnantBaseMoney = remnantBaseMoney;
	}

	public Long getRemnantFreezeMoney()
	{
		return remnantFreezeMoney;
	}

	public void setRemnantFreezeMoney(Long remnantFreezeMoney)
	{
		this.remnantFreezeMoney = remnantFreezeMoney;
	}

	public String getReferenceId()
	{
		return referenceId;
	}

	public void setReferenceId(String referenceId)
	{
		this.referenceId = referenceId;
	}

	public Long getMoney()
	{
		return money;
	}

	public void setMoney(Long money)
	{
		this.money = money;
	}

	public Date getTransTime()
	{
		return transTime;
	}

	public void setTransTime(Date transTime)
	{
		this.transTime = transTime;
	}

	public TradeMode getTradeMode()
	{
		return tradeMode;
	}

	public void setTradeMode(TradeMode tradeMode)
	{
		this.tradeMode = tradeMode;
	}

	public String getRemark()
	{
		return remark;
	}

	public void setRemark(String remark)
	{
		this.remark = remark;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public AccountType getAccountType()
	{
		return accountType;
	}

	public void setAccountType(AccountType accountType)
	{
		this.accountType = accountType;
	}

}
